package com.example.master.mapper;

import com.example.master.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {

    @Select("select * from tb_user where id=#{id}")
    User getUserById(@Param("id") Integer id);

    @Select("select phone from tb_user where phone = #{phone}")
    String isExistPhone(@Param("phone") String phone);

    @Insert("insert into tb_user (phone) values (#{phone})")
    Integer addUser(String phone);
}
